From 2280a487735e78df67e38c802e573ec978deee0e Mon Sep 17 00:00:00 2001 From: "robertlipe@gmail.com" Date: Mon, 10 Dec 2012 20:02:31 +0000 Subject: [PATCH] Geoniche: Don't crash on empty input file. git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@4226 f51c46e8-681c-474f-0cfe-069cfd0219fb --- gpsbabel/geoniche.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gpsbabel/geoniche.c b/gpsbabel/geoniche.c index 4e9e0d059..1e6246d8e 100644 --- a/gpsbabel/geoniche.c +++ b/gpsbabel/geoniche.c @@ -203,7 +203,7 @@ geoniche_read_asc(void) /* Process record 0 */ pdb_rec = file_in->rec_list; - if (strcmp((char*) pdb_rec->data, Rec0Magic)) { + if (!pdb_rec || strcmp((char*) pdb_rec->data, Rec0Magic)) { fatal(MYNAME ": Bad record 0, not a GeoNiche file.\n"); } pdb_rec = pdb_rec->next; -- 2.30.2